package com.bwie.controller;

import com.bwie.service.SchoolService;
import com.bwie.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: day0617mounth
 * @ClassName SchoolController
 * @description:
 * @author: 段阳
 * @create: 2024-06-17 10:01
 **/
@RestController
@RequestMapping("school")
public class SchoolController {

    @Autowired
    private SchoolService schoolService;


    /**
    * //TODO
    * @author 段阳 
    * @date 2024/6/17 10:37
     * @param sid 
     * @return com.bwie.util.R
    */
    @PostMapping("/findCollegeBySid")
    public R findCollegeBySid(@RequestParam(name = "sid") Integer sid){
        return schoolService.findCollegeBySid(sid);
    }

    /**
    * //TODO
    * @author 段阳 
    * @date 2024/6/17 10:37
     * @param id 
     * @return com.bwie.util.R
    */
    @PostMapping("/findSchoolById")
    public R findSchoolById(@RequestParam(name = "id") Integer id){
        return schoolService.findSchoolById(id);
    }

    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 10:30
     * @return com.bwie.util.R
     */
    @PostMapping("/findSchoolList")
    public R findSchoolList(){
        return schoolService.findSchoolList();
    }
    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 10:30
     * @return com.bwie.util.R
     */
    @PostMapping("/findCollegeList")
    public R findCollegeList(@RequestParam(name = "sid") Integer sid){
        return schoolService.findCollegeList(sid);
    }
}